package com.qingzhuge.mq.producer.autoconfigure;

import com.qingzhuge.mq.IProducer;
import com.qingzhuge.mq.producer.activemq.ProducerActiveMq;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;

import javax.jms.ConnectionFactory;

/**
 * @author : zero.xiao
 * @description :
 * @date :2019-06-19 15:39
 * @modified :
 */
@ComponentScan("org.springframework.boot.autoconfigure.jms")
@Configuration
@EnableJms
@ConditionalOnBean(ConnectionFactory.class)
public class AutoMqProducerConfiguration {
    @Bean
    public IProducer producer(){
        return new ProducerActiveMq();
    }
}
